<%@ page import="java.util.*, model.bean.FilmeJB" %>
<%@page import="util.DataHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>BoxMovie - Busca</title>


<%@include file="js_css.jsp" %>


</head>
<body>
<div id="div_ver_trailer"></div>

<div id="tudo"><!-- div inicial - com todo conteudo -->
<div id="topo"><!-- div topo contem o menu -->

<%@include file="topo.jsp" %>

</div>
<!-- final div topo contem o menu -->

<div id="conteudo"><!--  /*/*/*/*/*/*/*/*/*/*/*/*/ div CONTEUDO   /*/*/*/*/*/*/*/*/*/*/*/*/ -->

<div id="busca_topo">
	<table width="800" height="300" cellpadding="0" cellspacing="0">
		<tr width="100%" height="105">
			<td width="265" height="105" onclick="window.location='busca?nome=nao&opcao=lancamentos&pag=1'">		
			&nbsp;
			</td>	
			<td width="265" height="100" onclick="window.location='busca?nome=nao&opcao=mais_locados&pag=1'">		
			&nbsp;
			</td>
			<td width="265" height="100" onclick="window.location='busca?nome=nao&opcao=nome_filme&pag=1'">		
			&nbsp;
			</td>
		</tr>
		<tr height="195">
			<td colspan="3" width="100%">
			<table width="100%" height="100%" cellpadding="0" cellspacing="2" >
				<tr>


				<td width="25" valign="bottom">
				&nbsp;
				</td>
				<td width="200" style="padding-top: 110px;">
					<input type="text" value="" class="input" id="input_nome" name="input_nome" />
				</td>
				<td  style="padding-top: 100px;">
 					<input type="image" src="./imagens/button_ok.png" class="input_ok" onclick="window.location='busca?nome=sim&pag=1&opcao='+document.getElementById('input_nome').value;" />
				</td>
				
				
					<td width="67" onclick="window.location='busca?nome=nao&opcao=Acao&pag=1'">
					&nbsp;
					</td>
										
					<td width="67" onclick="window.location='busca?nome=nao&opcao=Drama&pag=1'">
					&nbsp;
					</td>
										
					<td width="67" onclick="window.location='busca?nome=nao&opcao=Ficcao&pag=1'">
					&nbsp;
					</td>
										
					<td width="67" onclick="window.location='busca?nome=nao&opcao=Terror&pag=1'">
					&nbsp;
					</td>
															
					<td width="67" onclick="window.location='busca?nome=nao&opcao=Comedia&pag=1'">
					&nbsp;
					</td>
															
					<td width="67" onclick="window.location='busca?nome=nao&opcao=Romance&pag=1'">
					&nbsp;
					</td>
					
					<td width="67" onclick="window.location='busca?nome=nao&opcao=Policial&pag=1'">
					&nbsp;
					</td>
					
					<td>
					
					</td>									
				</tr>			
			</table>
			</td>		
		</tr>
	</table>
</div>


<div id="resultado_busca">
<div id="resultado_busca_interna">

			<%
				ArrayList<FilmeJB> busca = null;
				busca = (ArrayList<FilmeJB>) request.getSession().getAttribute("busca");
			%>

	<table width="700" height="600" cellpadding="0" cellspacing="0">
		<tr>
		<% int i = 0;
			for (i = 0; i < busca.size(); i++) {
		%>		
			<td width="350" height="200" style="border: 1px solid #85A7C0;">	
						
			<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>
					<table border="0" width="100%" cellspacing="7" cellpadding="2">
						<tr>
							<td>
								<img src="capas/<%=busca.get(i).getCapa()%>" onclick="verTrailer('<%= busca.get(i).getId() %>','<%= busca.get(i).getTitulo() %>')" />	
							</td>
						</tr>
					</table>
					</td>
					<td valign="top">
					<table border="0" width="100%" cellspacing="7" cellpadding="2" height="105">
						<tr>
							<td align="left">
								<h5><font color="#85A7C0">Titulo</font></h5>
								<h3><font face="Trebuchet MS"><b><%= busca.get(i).getTitulo() %></b></font></h3>
							</td>
						</tr>
						<tr>
							<td align="left">
								<h5><font color="#85A7C0">Lançamento</font></h5>
								<h3><font face="Trebuchet MS"><%= DataHelper.dateDBToString(busca.get(i).getDtLancFilme()) %></font></h3>
							</td>
						</tr>
						<tr>
							<td align="left">
								<h5><font color="#85A7C0">Gênero</font></h5>
								<h3><font face="Trebuchet MS"><%= busca.get(i).getGenero().getNome() %></font></h3>
							</td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
						
			
			
				
			
			
		<%if ((i+1)%2 == 0){%>
			</td>
		</tr>
		<tr>
		<%}else{%>
			</td>
		<%}
		}
		%>			
		 <tr>				
	</table>

<div id="links_paginacao_busca">
<a href="busca?nome=<%= request.getParameter("nome") %>&opcao=<%= request.getSession().getAttribute("opcao") %>&pag=1" title="Filmes Localizar">[<<]</a>
	&nbsp;   &nbsp;  

<a href="busca?nome=<%= request.getParameter("nome") %>&opcao=<%= request.getSession().getAttribute("opcao") %>&pag=<%= request.getSession().getAttribute("ant") %>" title="Filmes Localizar">[<]</a>
	&nbsp;   &nbsp;  

<span><%= request.getSession().getAttribute("pag") %></span>
	&nbsp;   &nbsp;  

<a href="busca?nome=<%= request.getParameter("nome") %>&opcao=<%= request.getSession().getAttribute("opcao") %>&pag=<%= request.getSession().getAttribute("pos") %>" title="Filmes Localizar">[>]</a>
	&nbsp;   &nbsp;   
    
<a href="busca?nome=<%= request.getParameter("nome") %>&opcao=<%= request.getSession().getAttribute("opcao") %>&pag=<%= request.getSession().getAttribute("total_pag") %>" title="Filmes Localizar">[>>]</a>
    
</div>

</div> <!-- final DIV resultado_busca_interna -->
</div> <!-- final DIV resultado_busca -->

</div><!--  /*/*/*/*/*/*/*/*/*/*/*/*/ final div CONTEUDO   /*/*/*/*/*/*/*/*/*/*/*/*/ -->




<div id="rodape">

<%@include file="rodape.jsp" %>

</div>
</div>

</body>
</html>